package com.buptcpr.demo.common;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class JwtConfig {
    @Bean
    public FilterRegistrationBean basicFilterRegistrationBean(){
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new JwtFilter());

        List<String> urlPatterns = new ArrayList<>();
        urlPatterns.add("/college/all");
        registrationBean.setUrlPatterns(urlPatterns);
        return registrationBean;
    }

}
